/**
 * added by zhangwei 2005-08-24
 */
package com.ctg.platform.core.util;


/**
 * @author fabianofranz@users.sourceforge.net
 * 
 * A singleton responsible to create valid uuid identifiers.
 */
public class UUIDService {

	private static final UUIDService instance = new UUIDService();

	static public UUIDService getInstance() {
		return instance;
	}

	/**
	 * Gera um UUID �nico no espa�o tempo, utiliza apenas hex.
	 * 
	 * @return String
	 */
	public String simpleHex(String separator) {
		return (String) new UUIDHexGenerator(separator).generate();
	}

	/**
	 * Gera um UUID �nico no espa�o tempo, utiliza apenas hex, sem separador.
	 * 
	 * @return String
	 */
	public String simpleHex() {
		return (String) new UUIDHexGenerator().generate();
	}
	
	/**
	 * Gera um UUID �nico no espa�o tempo, utiliza apenas hex, sem separador.
	 * 
	 * @return String
	 */
	public String simpleHexTwo() {
		return (String) new UUIDHexGenerator().generateTwo();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		for (int i = 0; i < 10; i++) {
			System.out.println(UUIDService.getInstance().simpleHex());
		}
//		Map map = new HashMap();
//		map.put("key1","value1");
//		map.put("key2","value2");
//		Map.Entry entry = (Entry) map.entrySet().iterator().next();
//		Object key = entry.getKey();
//		Object value = entry.getValue();
		return;
	}
}
